<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ClassBaseInfoTeacher extends Model
{
    protected $table = 'class_base_info_teacher';
    public $timestamps = FALSE;

    public function teacher()
    {
        return $this->hasOne(Teacher::class,'id', 'teacher_id');
    }

    public function getDesignatedDateAttribute($value)
    {
        if(!empty($value)){
            $designate_date = explode(',', $value);
            sort($designate_date);
        }else{
            $designate_date = [];
        }

        return $designate_date;
    }
}
